import { defineStore } from 'pinia';
import router from '@/router';
export const useUserStore = defineStore('user', {
  state: () => ({
    userInfo: {},
    menu: [...router.options.routes],
  }),
  actions: {
    // 登录
    login() {},
    // 退出登录
    logout() {},
    // 获取用户信息
    constructorUserInfo() {},
  },
  getters: {
    getUserInfo: (state) => state.userInfo,
    getMenu: (state) => state.menu.filter((item) => item.meta?.show),
  },
});
